package org.alis.smallcc.designpatterns.behavior.observer.spring;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class FileApplicationListener implements ApplicationListener<ChangeBusEvent>{

	@Override
	public void onApplicationEvent(ChangeBusEvent event) {
		String name = event.getProperties().get("name").toString();
		String source =  Objects.toString(event.getSource(),StringUtils.EMPTY);
		System.out.println("来自："+name+" 发送的->"+source);
	}

	

}
